package com.rex.motan.demo;

import com.weibo.api.motan.config.springsupport.annotation.MotanReferer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class MotanClientApplication {

	public DemoService service;

	//坑点二 通过字段上加注解未能注入，必须是方法，三观已毁。
	@MotanReferer(basicReferer="demoreferer",group = "motandemo")
	public void setDemoService(DemoService service){
		this.service = service;
	}
	@RequestMapping("/")
	public String call(){
		return service.call("test");
	}
	public static void main(String[] args) {
		SpringApplication.run(MotanClientApplication.class, args);
	}

}
